<template>
        <el-container>
            <el-header  >
<!--                style="height: 45px;"-->
                <el-menu :router='true' mode="horizontal"  default-active="Index"
                         class="el-menu-demo" background-color="#fff" text-color="#909399"  active-text-color="#409EFF">
                    <el-menu-item index="Index">外卖平台首页</el-menu-item>
                    <el-menu-item index="ShopCart">购物车</el-menu-item>
                    <el-menu-item index="Order">订单中心</el-menu-item>
                    <el-menu-item index="PerCenter">个人信息中心</el-menu-item>
<!--                    <el-menu-item index="PerCenter">个人中心</el-menu-item>-->
                    <el-menu-item @click="logout">用户  {{this.nickname}} 退出登录</el-menu-item>
                    <el-menu-item><div class="block"><el-avatar :size="50"  shape="square"  :src="circleUrl"></el-avatar></div></el-menu-item>
                </el-menu>

            </el-header>
            <el-main>
                <router-view></router-view>
            </el-main>
        </el-container>
</template>
<script>

export default {
    data() {
        return {
            username:'',
            circleUrl: window.sessionStorage.getItem("userimg"),
            nick:"",
        };
    },
    created() {
        this.nickname = window.sessionStorage.getItem('nickname');
    },
    methods: {
        logout(){
            // console.log("退出");
            window.sessionStorage.removeItem('token');
            this.$router.push('/login')
        },
    },
    watch:{
    }
}
</script>

<style scoped>

</style>

